import { takeEvery, put } from "redux-saga/effects";
const delay = (time) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve();
    }, time);
  });
};

function* fn1() {
  yield delay(1000);
  yield put({ type: "add" });
}

function* mySaga() {
  yield takeEvery("addAction", fn1);
}

export default mySaga;
